<p>Gợi ý:</p>

<p>PP quy hoạch động:</p>

<p>Consider the number, that is our answer and factorize it. We will get such product <em>p</em><sub>1</sub><sup><em>a</em><sub>1</sub></sup>&middot; <em>p</em><sub>2</sub><sup><em>a</em><sub>2</sub></sup>&middot; ... &middot; <em>p</em><sub><em>k</em></sub><sup><em>a</em><sub><em>k</em></sub></sup>. Product through each i <em>a</em><sub><em>i</em></sub>&thinsp;+&thinsp;1 will be the number of divisors. So, if we will take first 10 prime numbers, their product will have 1024 divisors. This means that we need only first 10 primes to build our answer.<br />
&nbsp; Let&#39;s do it with dynamic programming: d[i][j] - the minimal number with i divisors that can be built with first j prime numbers. To calculate the answer for state (i, j) let&#39;s look over all powers of j-th prime number in the answer. If j-th prime number has power k in the answer, than <em>d</em>[<em>i</em>][<em>j</em>]&thinsp;=&thinsp;<em>d</em>[<em>i</em>&thinsp;/&thinsp;(<em>k</em>&thinsp;+&thinsp;1)][<em>j</em>&thinsp;-&thinsp;1]&thinsp;*&thinsp;<em>prime</em>[<em>j</em>]<sup><em>k</em></sup>. For each power of j-th prime we must select the power, that gives us minimal d[i][j].<br />
You should be extremely careful during the implementation, because all calculations are made on the edge of overflow.</p>
